package cate.game.role.farm.spicefb.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBSpiceFb;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "水晶峡谷关卡挑战 の 请求")
@OperationSetter(value = GDOperation.SPICE_FB_CHALLENGE, sub = "combatNum")
public class SpiceFbChallengeReq implements MsgInput {
    @NoteField(value = "第几关")
    public int combatNum;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = cc.getRole().getFarm().spiceFb.challenge(combatNum);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r, true);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBSpiceFb.CHALLENGE_REQ;
    }
}
